<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.18"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>HElib: helib::KeySwitch Class Reference</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
		<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;1,700&family=Merriweather&family=Merriweather+Sans&family=Open+Sans&family=Poppins:ital@1&family=Roboto:ital,wght@0,400;1,300;1,900&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body style="font-family: 'Merriweather', serif;">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">HElib Implementing Homomorphic Encryption</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacehelib.html">helib</a></li><li class="navelem"><a class="el" href="classhelib_1_1_key_switch.html">KeySwitch</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="classhelib_1_1_key_switch-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">helib::KeySwitch Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Key-switching matrices.  
 <a href="classhelib_1_1_key_switch.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="key_switching_8h_source.html">keySwitching.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a74d6cc93536febfff257b19fc63dc060"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a74d6cc93536febfff257b19fc63dc060">KeySwitch</a> (long sPow=0, long xPow=0, long fromID=0, long toID=0, long p=0)</td></tr>
<tr class="separator:a74d6cc93536febfff257b19fc63dc060"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3cd8c681d701db5837260703b7b73b00"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a3cd8c681d701db5837260703b7b73b00">KeySwitch</a> (const <a class="el" href="classhelib_1_1_s_k_handle.html">SKHandle</a> &amp;_fromKey, long fromID=0, long toID=0, long p=0)</td></tr>
<tr class="separator:a3cd8c681d701db5837260703b7b73b00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70670acc9c59290c0e668455108aecec"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a70670acc9c59290c0e668455108aecec">operator==</a> (const <a class="el" href="classhelib_1_1_key_switch.html">KeySwitch</a> &amp;other) const</td></tr>
<tr class="separator:a70670acc9c59290c0e668455108aecec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa654d241726845e7a4b3c89ecf701596"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#aa654d241726845e7a4b3c89ecf701596">operator!=</a> (const <a class="el" href="classhelib_1_1_key_switch.html">KeySwitch</a> &amp;other) const</td></tr>
<tr class="separator:aa654d241726845e7a4b3c89ecf701596"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5e067d1594615c8c3c44acb941e484f"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#af5e067d1594615c8c3c44acb941e484f">NumCols</a> () const</td></tr>
<tr class="separator:af5e067d1594615c8c3c44acb941e484f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d5b6037b48b01c67bf29b0ae19f16e0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a0d5b6037b48b01c67bf29b0ae19f16e0">isDummy</a> () const</td></tr>
<tr class="separator:a0d5b6037b48b01c67bf29b0ae19f16e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84794d2ce7f58d204b2d561b443dc9ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a84794d2ce7f58d204b2d561b443dc9ba">verify</a> (<a class="el" href="classhelib_1_1_sec_key.html">SecKey</a> &amp;sk)</td></tr>
<tr class="memdesc:a84794d2ce7f58d204b2d561b443dc9ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">A debugging method.  <a href="classhelib_1_1_key_switch.html#a84794d2ce7f58d204b2d561b443dc9ba">More...</a><br /></td></tr>
<tr class="separator:a84794d2ce7f58d204b2d561b443dc9ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d0189576a8418468aa50e6f7e5e2ca8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a9d0189576a8418468aa50e6f7e5e2ca8">readMatrix</a> (std::istream &amp;str, const <a class="el" href="classhelib_1_1_context.html">Context</a> &amp;context)</td></tr>
<tr class="memdesc:a9d0189576a8418468aa50e6f7e5e2ca8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a key-switching matrix from input.  <a href="classhelib_1_1_key_switch.html#a9d0189576a8418468aa50e6f7e5e2ca8">More...</a><br /></td></tr>
<tr class="separator:a9d0189576a8418468aa50e6f7e5e2ca8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6dd127dd7552981ab1a6b74d2f0a141b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a6dd127dd7552981ab1a6b74d2f0a141b">read</a> (std::istream &amp;str, const <a class="el" href="classhelib_1_1_context.html">Context</a> &amp;context)</td></tr>
<tr class="memdesc:a6dd127dd7552981ab1a6b74d2f0a141b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Raw IO.  <a href="classhelib_1_1_key_switch.html#a6dd127dd7552981ab1a6b74d2f0a141b">More...</a><br /></td></tr>
<tr class="separator:a6dd127dd7552981ab1a6b74d2f0a141b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d5aacb77d9bf361522e29811e8994ca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a7d5aacb77d9bf361522e29811e8994ca">write</a> (std::ostream &amp;str) const</td></tr>
<tr class="separator:a7d5aacb77d9bf361522e29811e8994ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:afc9320fe88ca2cda85f04c362de85442"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="classhelib_1_1_key_switch.html">KeySwitch</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#afc9320fe88ca2cda85f04c362de85442">dummy</a> ()</td></tr>
<tr class="memdesc:afc9320fe88ca2cda85f04c362de85442"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns a dummy static matrix with toKeyId == -1  <a href="classhelib_1_1_key_switch.html#afc9320fe88ca2cda85f04c362de85442">More...</a><br /></td></tr>
<tr class="separator:afc9320fe88ca2cda85f04c362de85442"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a5b8267d055a0224c42ef247ddc7057f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classhelib_1_1_s_k_handle.html">SKHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a5b8267d055a0224c42ef247ddc7057f9">fromKey</a></td></tr>
<tr class="separator:a5b8267d055a0224c42ef247ddc7057f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab051ee75017f2de075ed0aaf94f3210c"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#ab051ee75017f2de075ed0aaf94f3210c">toKeyID</a></td></tr>
<tr class="separator:ab051ee75017f2de075ed0aaf94f3210c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8651e62e5105034f136a63c7d9d823f6"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a8651e62e5105034f136a63c7d9d823f6">ptxtSpace</a></td></tr>
<tr class="separator:a8651e62e5105034f136a63c7d9d823f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1467771b15e14a274ce6dcb20399af13"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a1467771b15e14a274ce6dcb20399af13">b</a></td></tr>
<tr class="separator:a1467771b15e14a274ce6dcb20399af13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4d2dcf11d6e9edfa769cdaa764f5a5f"><td class="memItemLeft" align="right" valign="top">NTL::ZZ&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#af4d2dcf11d6e9edfa769cdaa764f5a5f">prgSeed</a></td></tr>
<tr class="separator:af4d2dcf11d6e9edfa769cdaa764f5a5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a635d31b573c39ab850ea8a5a9155d6ce"><td class="memItemLeft" align="right" valign="top">NTL::xdouble&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhelib_1_1_key_switch.html#a635d31b573c39ab850ea8a5a9155d6ce">noiseBound</a></td></tr>
<tr class="separator:a635d31b573c39ab850ea8a5a9155d6ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Key-switching matrices. </p>
<p>There are basically two approaches for how to do key-switching: either decompose the mod-q ciphertext into bits (or digits) to make it low-norm, or perform the key-switching operation mod Q&gt;&gt;q. The tradeoff is that when decomposing the (coefficients of the) ciphertext into t digits, we need to increase the size of the key-switching matrix by a factor of t (and the running time similarly grows). On the other hand if we do not decompose at all then we need to work modulo Q&gt;q^2, which means that the bitsize of our largest modulus q0 more than doubles (and hence also the parameter m more than doubles). In general if we decompose into digits of size B then we need to work with Q&gt;q*B.)</p>
<p>The part of the spectrum where we expect to find the sweet spot is when we decompose the ciphertext into digits of size B=q0^{1/t} for some small constant t (maybe t=2,3 or so). This means that our largest modulus has to be Q&gt;q0^{1+1/t}, which increases also the parameter m by a factor (1+1/t). It also means that for key-switching in the top levels we would break the ciphertext to t digits, hence the key-switching matrix will have t columns.</p>
<p>A key-switch matrix W[s'-&gt;s] converts a ciphertext-part with respect to secret-key polynomial s' into a canonical ciphertext (i.e. a two-part ciphertext with respect to (1,s)). The matrix W is a 2-by-t matrix of <a class="el" href="classhelib_1_1_double_c_r_t.html" title="Implementing polynomials (elements in the ring R_Q) in double-CRT form.">DoubleCRT</a> objects. The bottom row are just (pseudo)random elements. Then for column j, if the bottom element is aj then the top element is set as bj = P*Bj*s' + p*ej - s * aj mod P*q0, where p is the plaintext space (i.e. 2 or 2^r, or 1 for <a class="el" href="structhelib_1_1_c_k_k_s.html" title="Type for CKKS scheme, to be used as template parameter.">CKKS</a>) and Bj is the product of the digits-sizes corresponding to columns 0...i-1. (For example if we have digit sizes 3,5,7 then B0=1, B1=3, B2=15 and B3=105.) Also, q0 is the product of all the "ciphertext primes" and P is roughly the product of all the special primes. (Actually, for <a class="el" href="structhelib_1_1_b_g_v.html" title="Type for BGV scheme, to be used as template parameter.">BGV</a>, if Q is the product of all the special primes then P=Q*(Q^{-1} mod p).)</p>
<p>In this implementation we save some space, by keeping only a PRG seed for generating the pseudo-random elements, rather than the elements themselves.</p>
<p>To convert a ciphertext part R, we break R into digits R = sum_j Bj Rj, then set (q0,q1)^T = sum_j Rj * column-j. Note that we have &lt;(1,s),(q0,q1)&gt; = sum_j Rj*(s*aj - s*aj + p*ej +P*Bj*s') = P * sum_j Bj*Rj * s' + p sum_j Rj*ej = P * R * s' + p*a-small-element (mod P*q0) where the last element is small since the ej's are small and |Rj|&lt;B. Note that if the ciphertext is encrypted relative to plaintext space p' and then key-switched with matrices W relative to plaintext space p, then we get a mew ciphertext with noise p'*small+p*small, so it is valid relative to plaintext space GCD(p',p).</p>
<p>The matrix W is defined modulo Q&gt;t*B*sigma*q0 (with sigma a bound on the size of the ej's), and Q is the product of all the small primes in our moduli chain. However, if p is much smaller than B then is is enough to use W mod Qi with Qi a smaller modulus, Q&gt;p*sigma*q0. Also note that if p&lt;Br then we will be using only first r columns of the matrix W. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a74d6cc93536febfff257b19fc63dc060"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a74d6cc93536febfff257b19fc63dc060">&#9670;&nbsp;</a></span>KeySwitch() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">helib::KeySwitch::KeySwitch </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>sPow</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>xPow</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>fromID</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>toID</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>p</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a3cd8c681d701db5837260703b7b73b00"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3cd8c681d701db5837260703b7b73b00">&#9670;&nbsp;</a></span>KeySwitch() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">helib::KeySwitch::KeySwitch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classhelib_1_1_s_k_handle.html">SKHandle</a> &amp;&#160;</td>
          <td class="paramname"><em>_fromKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>fromID</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>toID</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>p</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="afc9320fe88ca2cda85f04c362de85442"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afc9320fe88ca2cda85f04c362de85442">&#9670;&nbsp;</a></span>dummy()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classhelib_1_1_key_switch.html">KeySwitch</a> &amp; helib::KeySwitch::dummy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>returns a dummy static matrix with toKeyId == -1 </p>

</div>
</div>
<a id="a0d5b6037b48b01c67bf29b0ae19f16e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d5b6037b48b01c67bf29b0ae19f16e0">&#9670;&nbsp;</a></span>isDummy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool helib::KeySwitch::isDummy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="af5e067d1594615c8c3c44acb941e484f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af5e067d1594615c8c3c44acb941e484f">&#9670;&nbsp;</a></span>NumCols()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned long helib::KeySwitch::NumCols </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aa654d241726845e7a4b3c89ecf701596"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa654d241726845e7a4b3c89ecf701596">&#9670;&nbsp;</a></span>operator!=()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool helib::KeySwitch::operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classhelib_1_1_key_switch.html">KeySwitch</a> &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a70670acc9c59290c0e668455108aecec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70670acc9c59290c0e668455108aecec">&#9670;&nbsp;</a></span>operator==()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool helib::KeySwitch::operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classhelib_1_1_key_switch.html">KeySwitch</a> &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a6dd127dd7552981ab1a6b74d2f0a141b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6dd127dd7552981ab1a6b74d2f0a141b">&#9670;&nbsp;</a></span>read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void helib::KeySwitch::read </td>
          <td>(</td>
          <td class="paramtype">std::istream &amp;&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classhelib_1_1_context.html">Context</a> &amp;&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Raw IO. </p>

</div>
</div>
<a id="a9d0189576a8418468aa50e6f7e5e2ca8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d0189576a8418468aa50e6f7e5e2ca8">&#9670;&nbsp;</a></span>readMatrix()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void helib::KeySwitch::readMatrix </td>
          <td>(</td>
          <td class="paramtype">std::istream &amp;&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classhelib_1_1_context.html">Context</a> &amp;&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read a key-switching matrix from input. </p>

</div>
</div>
<a id="a84794d2ce7f58d204b2d561b443dc9ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84794d2ce7f58d204b2d561b443dc9ba">&#9670;&nbsp;</a></span>verify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void helib::KeySwitch::verify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classhelib_1_1_sec_key.html">SecKey</a> &amp;&#160;</td>
          <td class="paramname"><em>sk</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A debugging method. </p>

</div>
</div>
<a id="a7d5aacb77d9bf361522e29811e8994ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d5aacb77d9bf361522e29811e8994ca">&#9670;&nbsp;</a></span>write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void helib::KeySwitch::write </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a1467771b15e14a274ce6dcb20399af13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1467771b15e14a274ce6dcb20399af13">&#9670;&nbsp;</a></span>b</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt;<a class="el" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&gt; helib::KeySwitch::b</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a5b8267d055a0224c42ef247ddc7057f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b8267d055a0224c42ef247ddc7057f9">&#9670;&nbsp;</a></span>fromKey</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classhelib_1_1_s_k_handle.html">SKHandle</a> helib::KeySwitch::fromKey</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a635d31b573c39ab850ea8a5a9155d6ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a635d31b573c39ab850ea8a5a9155d6ce">&#9670;&nbsp;</a></span>noiseBound</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NTL::xdouble helib::KeySwitch::noiseBound</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="af4d2dcf11d6e9edfa769cdaa764f5a5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af4d2dcf11d6e9edfa769cdaa764f5a5f">&#9670;&nbsp;</a></span>prgSeed</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NTL::ZZ helib::KeySwitch::prgSeed</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a8651e62e5105034f136a63c7d9d823f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8651e62e5105034f136a63c7d9d823f6">&#9670;&nbsp;</a></span>ptxtSpace</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long helib::KeySwitch::ptxtSpace</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ab051ee75017f2de075ed0aaf94f3210c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab051ee75017f2de075ed0aaf94f3210c">&#9670;&nbsp;</a></span>toKeyID</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long helib::KeySwitch::toKeyID</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/HElib/include/helib/<a class="el" href="key_switching_8h_source.html">keySwitching.h</a></li>
<li>/HElib/src/<a class="el" href="key_switching_8cpp.html">keySwitching.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
        <script type="text/javascript" src="doxy-boot.js"></script>
</html>
